# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2024/2/29
desc: 
sample: 
"""
import random

from rest_framework import serializers

from api.models import Record


class RecordSerializer(serializers.ModelSerializer):
    income_desc = serializers.SerializerMethodField(label='薪资', read_only=True)

    def get_income_desc(self, instance):
        if instance.income_monthly==0:
            return '无'
        args =['12','13','14']
        return str(instance.income_monthly)+"k"

    class Meta:
        model = Record
        fields = '__all__'